package com.mapull.enums;

/**
 * @author mapull
 * @date 2022-07-03
 */
public enum SeasonEnum {
    /**
     * 季节
     */
    SPRING("春"), SUMMER("夏"), AUTUMN("秋"), WINTER("冬");

    SeasonEnum(String name) {
        this.name = name;
    }

    private String name;

    private static final SeasonEnum[] vals = values();

    /**
     * 前一个、上一个
     */
    public SeasonEnum prev(){
        return vals[(this.ordinal() - 1 + vals.length) % vals.length];
    }

    /**
     * 后一个、下一个
     */
    public SeasonEnum next(){
        return vals[(this.ordinal() + 1) % vals.length];
    }
}
